projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3917c26
)
cmd: spi: check return value of strdup
author
Peng Fan
<
[email protected]
>
Sun, 20 Mar 2016 13:21:36 +0000
(21:21 +0800)
committer
Tom Rini
<
[email protected]
>
Sun, 27 Mar 2016 13:12:55 +0000
(09:12 -0400)
Check return value of strdup.
Signed-off-by: Peng Fan <
[email protected]
>
Cc: Przemyslaw Marczak <
[email protected]
>
Cc: Bin Meng <
[email protected]
>
Cc: Heiko Schocher <
[email protected]
>
Cc: Simon Glass <
[email protected]
>
Cc: Stefan Roese <
[email protected]
>
Cc: Tom Rini <
[email protected]
>
cmd/spi.c
patch
|
blob
|
history
diff --git
a/cmd/spi.c
b/cmd/spi.c
index 64c3ffcf423b35fc1b0a65daccb99d490a053c5f..f16ef9a5db554077179a3ef5cbac00ce7e773b09 100644
(file)
--- a/
cmd/spi.c
+++ b/
cmd/spi.c
@@
-51,6
+51,8
@@
static int do_spi_xfer(int bus, int cs)
snprintf(name, sizeof(name), "generic_%d:%d", bus, cs);
str = strdup(name);
+ if (!str)
+ return -ENOMEM;
ret = spi_get_bus_and_cs(bus, cs, 1000000, mode, "spi_generic_drv",
str, &dev, &slave);
if (ret)